|
|
|
|
|
|
|
|
The toolbar button for adding new forms and modules is a drop-down button, which means clicking on the arrow gives you a list of items. After an item has been selected, the icon on the button changes.  |
|
|
|
|
|
|
|
|
|
|
Working with Multiple Forms |
|
|
|
|
|
|
|
|
Although some programs you write will be simple enough that you can use a single form, most will be made up of multiple forms. One reason for this is the limitation of the amount of space on a single form. Another, more important, reason is that you will want to use multiple forms in your program to separate program tasks logically. For example, if you have a task in your program that is not performed often, putting it onto a separate form makes more sense than trying to squeeze it onto a single form with everything else. Also, by loading and unloading forms as you need them, you can save system resources. In other words, your program takes up as little space as possible while running. |
|
|
|
|
|
|
|
|
Adding New Forms to Your Program |
|
|
|
|
|
|
|
|
When Visual Basic first starts a new project, typically it loads one blank form, as shown in Figure 11.5. As you design your program, you add controls to this form and write code to handle events that occur on the form. |
|
|
|
|
|
|
|
|
Figure 11.5
Visual Basic starts a new project with a single blank form. |
|
|
|
|
|
|
|
|
At some point in your design, you may decide that you need one or more additional forms to handle a new task or provide space to relieve the crowding on the initial form. Adding a new form is simple. You can either click the Add Form button or select Project, Add Form. This |
|
|
|
|
|